Skip to content

DRA implementation#1455

Open
SchSeba wants to merge 2 commits intok8snetworkplumbingwg:masterfrom
SchSeba:dra_implementation
Open

DRA implementation#1455
SchSeba wants to merge 2 commits intok8snetworkplumbingwg:masterfrom
SchSeba:dra_implementation

Conversation

@SchSeba
Copy link
Contributor

@SchSeba SchSeba commented Oct 23, 2025

No description provided.

@SchSeba SchSeba force-pushed the dra_implementation branch 2 times, most recently from db5d52d to 807fbef Compare October 23, 2025 12:26
@SchSeba SchSeba changed the title Dra implementation DRA implementation Oct 23, 2025
@SchSeba SchSeba force-pushed the dra_implementation branch 2 times, most recently from 513bba2 to 08b17dd Compare October 26, 2025 09:41
@SchSeba
Copy link
Contributor Author

SchSeba commented Oct 30, 2025

connected to k8snetworkplumbingwg/dra-driver-sriov#7

@SchSeba
Copy link
Contributor Author

SchSeba commented Nov 3, 2025

Hi @moshe010 can you help a look on this? as you did the initial implementation for DRA

Copy link
Collaborator

@thomasferrandiz thomasferrandiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except the typo in the interface name

"gopkg.in/k8snetworkplumbingwg/multus-cni.v4/pkg/types"
)

type ClientInterace interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be ClientInterface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!
done

continue
}
logging.Debugf("getDeviceID: found device %s, checking for deviceID attribute", device.Name)
deviceID, exists := device.Attributes["k8s.cni.cncf.io/deviceID"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the k8s.cni.cncf.io/deviceID attribute is not defined anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right I was trying to use the same prefix that multus/cni use before to represent the deviceID that we need.

if you have a better attribute prefix let me know I am fine making the change :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern is about the link between the projects. Multus and SR-IOV DRA Driver would work together thanks to this label and the SR-IOV CNI would work thanks to deviceID field injected in the CNI config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right I was thinking maybe I can document this one to explain how it should get handled for other dra drivers that would like to have the same functionality
would that be ok and answer your concerned?

@SchSeba SchSeba force-pushed the dra_implementation branch from 08b17dd to 1bdfbea Compare January 13, 2026 14:12
Copy link
Contributor

@rollandf rollandf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Migrate Dynamic Resource Allocation (DRA) integration from the alpha
v1alpha2 API to the stable v1 API introduced in Kubernetes 1.34.

Major changes:
- Update RBAC permissions to access resource.k8s.io API resources
  (resourceclaims, resourceslices) instead of using kubelet API
- Replace kubelet-based DRA resource discovery with direct API queries
  using new draclient package
- Update documentation from ResourceClass to DeviceClass terminology
- Change resourceName annotation format to <claim-name>/<request-name>
- Update examples from NVIDIA-specific to generic SR-IOV usage
- Add comprehensive test coverage for DRA integration
- Remove CDI-based device handling in favor of k8s.cni.cncf.io/deviceID
  attributes

Technical details:
- Add draclient.GetPodResourceMap() call in k8sclient
- Remove getDRAResources() from kubeletclient (now queries API directly)
- Update to use ResourceClaimTemplate instead of ResourceClaim
- Fix protobuf field naming (CDIDevices -> CdiDevices)
- Add 6 new test cases for DRA scenarios in k8sclient_test.go

This migration enables Multus to work with the stable DRA API and
removes dependency on kubelet's PodResources API for DRA resources.

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
@SchSeba SchSeba force-pushed the dra_implementation branch from 1bdfbea to 51d97b9 Compare January 14, 2026 07:59
@coveralls
Copy link

Coverage Status

coverage: 50.822% (+1.1%) from 49.721%
when pulling 51d97b9 on SchSeba:dra_implementation
into 39d6a8f on k8snetworkplumbingwg:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants